<template>
  <div class="service">
    <div class="cha" @click="goBack">×</div>

    <img src="@/assets/imgs/middleWork/service.png" class="img" />
    <div class="form">
      <div class="box">
        <img src="@/assets/imgs/middleWork/phone.png" alt="" />
        <div>
          <div>云尘付热线</div>
          <div class="phone">400-888-2206</div>
        </div>
      </div>
      <div class="box">
        <img src="@/assets/imgs/middleWork/icon_.png" alt="" />
        <div>
          <div>商务电话</div>
          <div class="phone">029-88861183</div>
        </div>
      </div>
      <el-input
        v-model="search"
        placeholder="任何不知道，这里找答案"
        class="input_"
        @keyup.enter.native="searchFromWebsite"
        clearable
        ><i
          slot="suffix"
          class="el-input__icon el-icon-search-outlined"
          style="cursor: pointer"
          @click="searchFromWebsite"
        ></i
      ></el-input>
      <div class="footer">
        <div class="hint">
          您还可查看<span class="note" @click="openApiDoc">操作手册</span
          >了解更多
        </div>
        <el-button class="width140" type="primary" @click="downloadApiDoc"
          >下载操作手册
        </el-button>
      </div>
    </div>
  </div>
</template>

<script>
import download from "downloadjs";
import cObj from "@/utils/config";

export default {
  name: "middleWorkService",
  data() {
    return {
      search: "",
    };
  },
  methods: {
    goBack() {
      this.$router.back();
    },
    searchFromWebsite() {
      window.open(`${cObj.websiteUrl}helpAbout`);

      // if (process.env.VUE_APP_ENV == "production") {
      //   window.open("http://yuncnpay.com/helpAbout");
      // } else if (process.env.VUE_APP_ENV == "test") {
      //   window.open("http://192.168.2.142:30004/helpAbout");
      // } else if (process.env.VUE_APP_ENV == "pre") {
      //   window.open("http://pre.yuncnpay.com/helpAbout");
      // } else {
      //   window.open(`http://${window.location.hostname}:30004/helpAbout`);
      // }
    },
    openApiDoc() {
      window.open("/结算系统产品使用手册.pdf");
    },
    downloadApiDoc() {
      download("/结算系统产品使用手册.pdf");
    },
  },
};
</script>

<style lang="scss" scoped>
.service {
  width: 596px;
  height: 700px;
  background: #ffffff;
  box-shadow: 2px 11px 22px 0px rgba(208, 227, 251, 0.41);
  border-radius: 30px;
  margin: auto;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  .cha {
    right: 30px;
    top: 10px;
    position: absolute;
    font-size: 24px;
    cursor: pointer;
  }
  .img {
    width: 596px;
    height: 215px;
  }
  .form {
    padding: 70px 50px 0;
    color: #666;
    .box {
      display: flex;
      font-size: 16px;
      img {
        margin-right: 12px;
        width: 20px;
        height: 20px;
      }
      .phone {
        color: #03bfc6;
        margin-top: 20px;
        margin-bottom: 30px;
        font-weight: 500;
      }
    }
    .input_ {
      margin-top: 20px;
    }
    .footer {
      text-align: center;
      .hint {
        color: #bfbfbf;
        margin-top: 40px;
        margin-bottom: 10px;
        .note {
          color: #03bfc6;
          cursor: pointer;
        }
      }
      .width140 {
        width: 140px;
      }
    }
  }
}
</style>
